Constructor Specialization
نویسنده
چکیده
In the section on “challenging problems” in the proceedings from the first international workshop on partial evaluation and mixed computation [BEJ88] a question is stated: “Can PE be used to generate new specialized data types, in a way analogous to generating specialized functions”. Since then little has been done to address this problem. In [Lau89], new types are indeed generated, but they are all simpler versions of the types in the original program. It is, e.g. not possible to have types with more constructors than the types in the original program. I propose to alleviate this by means of constructor specialization. Constructors are specialized with respect to the static parts of their arguments, just like residual functions. I show how this is done and argue that it makes it possible to get good results from partial evaluation in cases where the traditional methods fail to produce satisfactory results. The discussion is centered around a small subset of Standard ML, but the idea applies equally well to other languages having user defined constructors, e.g. Haskell and Prolog.
منابع مشابه
A Simple Solution to Type Specialization
Partial evaluation specializes terms, but traditionally this specialization does not apply to the type of these terms. As a result, specializing, e.g., an interpreter written in a typed language, which requires a “universal” type to encode expressible values, yields residual programs with type tags all over. Neil Jones has stated that getting rid of these type tags was an open problem, despite ...
متن کاملEnd-User Class Definition in CAD Systems
The object-oriented paradigm is very used in CAD systems. It permits users to create objects and to interrogate their attributes to use them in other processes. While some CAD or drawing systems support end-user programming in order to abstract building functions, none of them permit creating classes where several functions (constructor and selectors) share the same data. A data model that perm...
متن کاملCorrectness of Copy in Calculi with Letrec, Case and Constructors
Call-by-need lambda calculi with letrec provide a rewritingbased operational semantics for (lazy) call-by-name functional languages. These calculi model the sharing behavior during evaluation more closely than let-based calculi that use a fixpoint combinator. In a previous paper we showed that the copy-transformation is correct for the small calculus LRλ. In this paper we demonstrate that the p...
متن کاملThe NO2 Data Model
This report describes NO 2 (New Object-Oriented data model), the data model of CoOMS 1. CoOMS is a structurally object-oriented database system currently under implementation at SNI 2. It is intended to serve as both, as a self-contained full-fledged database management system and as the database component of the ITH-ACA 3 kernel. In this report, we first describe the data modelling facilities ...
متن کاملA Perfect Specialization Model for Gravity Equation in Bilateral Trade based on Production Structure
Although initially originated as a totally empirical relationship to explain the volume of trade between two partners, gravity equation has been the focus of several theoretic models that try to explain it. Specialization models are of great importance in providing a solid theoretic ground for gravity equation in bilateral trade. Some research papers try to improve specialization models by addi...
متن کاملذخیره در منابع من
با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید
عنوان ژورنال:
دوره شماره
صفحات -
تاریخ انتشار 2005